<template>
    <div class="date-switch">
        <div @click="$emit('input', 1)" :class="{selected: value === 1}">本年</div>
        <div @click="$emit('input', 2)" :class="{selected: value === 2}">所有</div>
    </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export enum TimeRange {
    year = 1,
    all = 2
}

export default defineComponent({
    props: {
        value: Number
    }
})
</script>

<style scoped>
.date-switch {
    display: flex;
    gap: 1px;
}

.date-switch div {
    width: 48px;
    height: 24px;
    text-align: center;
    background: rgba(29, 28, 30, 0.1);
    box-shadow: inset 0px 0px 4px rgba(255, 255, 255, 0.25);
    font-family: 'OPPOSans';
    font-style: normal;
    font-weight: 400;
    font-size: 12px;
    line-height: 24px;
    font-feature-settings: 'tnum' on, 'lnum' on;
    color: #FFFFFF;
}

.date-switch div:first-child {
    border-radius: 4px 0px 0px 4px;
}

.date-switch div:last-child {
    border-radius: 0px 4px 4px 0px;
}

.date-switch div.selected {
    background: rgba(29, 28, 30, 0.1);
    box-shadow: inset 0px 0px 6px #9AF3EE;
    color: #9AF3EE;
}
</style>